package com.example.demo.sxt;

import java.awt.*;
import java.util.Random;

/**
 * @author : zhy
 * @since : 2022/7/20
 */
public class FoodObj extends GameObj{

    //定义一个随机函数
    Random random=new Random();

    //获取食物
    public FoodObj getFood()
    {
        return new FoodObj(GameUtil.foodImg,random.nextInt(20)*30,(random.nextInt(19)+1)*30,this.gameWin);
    }

    public FoodObj() {
        super();
    }

    public FoodObj(Image img, int x, int y, GameWin gameWin) {
        super(img, x, y, gameWin);
    }

    @Override
    public void paintSelf(Graphics g) {
        super.paintSelf(g);
    }
}
